<?php
namespace Popshouse\SiteBundle\Entity;


class Reservation{
	
	/**
	 * @assert:NotBlank
	 */
	protected $name;
	
	protected $tel;
	
	/**
	 * @assert:NotBlank
	 * @assert:Email
	 */
	protected $mail;
	
	/**
	 * @assert:NotBlank
	 * @assert:Min(1)
	 * @assert:Max(2)
	 */
	protected $nbRooms;
	
	/**
	 * @assert:NotBlank
	 * @assert:Min(1)
	 * @assert:Max(8)
	 */
	protected $nbGuests;
	
	/**
	 * @assert:NotBlank
	 */
	protected $dateStart;
	
	/**
	 * @assert:NotBlank
	 */
	protected $dateEnd;
	
	
	protected $info;
	
	/**
	 * @return the $name
	 */
	public function getName() {
		return $this->name;
	}

	/**
	 * @return the $tel
	 */
	public function getTel() {
		return $this->tel;
	}

	/**
	 * @return the $mail
	 */
	public function getMail() {
		return $this->mail;
	}

	/**
	 * @return the $nbRooms
	 */
	public function getNbRooms() {
		return $this->nbRooms;
	}

	/**
	 * @return the $nbGuests
	 */
	public function getNbGuests() {
		return $this->nbGuests;
	}

	/**
	 * @return the $dateStart
	 */
	public function getDateStart() {
		return $this->dateStart;
	}

	/**
	 * @return the $dateEnd
	 */
	public function getDateEnd() {
		return $this->dateEnd;
	}

	/**
	 * @return the $info
	 */
	public function getInfo() {
		return $this->info;
	}

	/**
	 * @param field_type $name
	 */
	public function setName($name) {
		$this->name = $name;
	}

	/**
	 * @param field_type $tel
	 */
	public function setTel($tel) {
		$this->tel = $tel;
	}

	/**
	 * @param field_type $mail
	 */
	public function setMail($mail) {
		$this->mail = $mail;
	}

	/**
	 * @param field_type $nbRooms
	 */
	public function setNbRooms($nbRooms) {
		$this->nbRooms = $nbRooms;
	}

	/**
	 * @param field_type $nbGuests
	 */
	public function setNbGuests($nbGuests) {
		$this->nbGuests = $nbGuests;
	}

	/**
	 * @param field_type $dateStart
	 */
	public function setDateStart($dateStart) {
		$this->dateStart = $dateStart;
	}

	/**
	 * @param field_type $dateEnd
	 */
	public function setDateEnd($dateEnd) {
		$this->dateEnd = $dateEnd;
	}

	/**
	 * @param field_type $info
	 */
	public function setInfo($info) {
		$this->info = $info;
	}

	
	public function send($mailer,$lang){
		/*if($translator === null)
			throw new \Exception("Geen translator opgegeven");*/
			
		$message = "<b>Aanvraag tot boeking:</b>\n<br/>";
		$message += "Taal: ".$lang."\n<br />";
		$message += "Naam: ".$this->getName()."\n<br />";
		$message += "Mail: ".$this->getMail()."\n<br />";
		$message += "Tel: ".$this->getTel()."\n<br />";
		$message += "Kamers: ".$this->getNbRooms()."\n<br />";
		$message += "Gasten: ".$this->getNbGuests()."\n<br />";
		$message += "Aankomst: ".$this->getDateStart()."\n<br />";
		$message += "Vertrek: ".$this->getDateEnd()."\n\n<br />";
		$message += "Overige info: ".$this->getInfo()."<br />";
		
		//require_once("Swift_Message.php");
		/*$mail = \Swift_Message::newInstance()
            ->setSubject("Aanvraag tot boeking")
            ->setFrom($this->getMail())
            ->setTo("seba.kerckhof@gmail.com")
            ->setBody($message);

        $mailer->send($mail);*/
        
        $headers = 'From: '. $this->getMail() . "\r\n" .
		    'Reply-To: '. $this->getMail() . "\r\n" .
		    'X-Mailer: PHP/' . phpversion();
        mail ("seba.kerckhof@gmail.com", "Aanvraag tot boeking", $message, $headers);
	}
	
	
}